package com.dy.course.enumerate;

public enum WeekDay {

	SUNDAY(1, "星期天"), MONDAY(2, "星期一"), TUESDAY(3, "星期二"), WEDNESDAY(4, "星期三"), THURSDAY(5, "星期四"), FRIDAY(6,
			"星期五"), SATURDAY(7, "星期六");

	private Integer code;
	private String desc;

	private WeekDay(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public Integer getCode() {
		return this.code;
	}

	public String getDesc() {
		return this.desc;
	}

	public boolean isCorrent(Integer code) {
		WeekDay[] mses = WeekDay.values();
		for (WeekDay ms : mses) {
			if (ms.getCode() == code) {
				return true;
			}
		}
		return false;
	}
}
